package com.small.site.vo;

import com.small.site.pojo.SysUser;
import com.small.site.vo.resp.PermissionRespNodeVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

/**
 * @author xiaochi
 * @date 2021/12/11 17:09
 * @desc 用户信息
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class UserDetailsVo extends SysUser implements UserDetails {

    private static final long serialVersionUID = 4223875899597301003L;
    private Collection<? extends GrantedAuthority> authorities;
    private boolean isAccountNonExpired = true;// 帐户是否过期(1 未过期，0已过期)
    private boolean isAccountNonLocked = true;// 帐户是否被锁定(1 未锁定，0已锁定)
    private boolean isCredentialsNonExpired = true;// 密码是否过期(1 未过期，0已过期)
    private boolean isEnabled = true;// 帐户是否可用(1 可用，0 删除用户)
    List<PermissionRespNodeVo> menus;// 用于登录成功返回用户权限菜单
    List<String> permissions;// 前端按钮权限标识
}